#ifndef MUTISERIALCONTROL_H
#define MUTISERIALCONTROL_H
#include "../mBPSK_Demodulator/BPSK_Demodulator.h"
#include <QSerialPort>
#include <QTimer>
#include <QDateTime>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE


class MutiSerialControl : public QObject
{
    Q_OBJECT
public:
    explicit MutiSerialControl(QObject *parent = nullptr);

    int find_start_lable[SERIAL_PORT_COUNT] = {0,0}; //查找FF FF标志
    QSerialPort *serialPort[SERIAL_PORT_COUNT];    //两路接收串口
    QSerialPort *sendDecDataPort;  //发送串口
    QTimer *timer[SERIAL_PORT_COUNT];    //接收信息时钟
    FIFO_Receiver fifoReceiver1[SERIAL_PORT_COUNT];
    void reset_Serial_Param(int hzType);
    void start_Serial(int hzType);
    void stop_Serial(int hzType);
    void init_Serial(int PreSignalLen);
    int portStatus[4]={0};
    int FragmentLen = 0;
    int SerialTotalLen = 0;
signals:
    void sendToDemoudle(int hzType);
private:

};

#endif // MUTISERIALCONTROL_H
